<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="(book,index) in books">{{index}}--{{book.name}}</li>
        </ul>
        <div v-if="show">v-if指令</div>
        <div v-show="show">v-show指令</div>         <!--v-if会直接破坏底层DOM,v-show只是将
                                                        元素的display设为none不会破坏其底层结构--> 
    </div>
</body>
<script>
    new Vue({
        el:'#app',
        data:{
            books:[
                {name:'Vue无难事'},
                {name:'VC++深入详解'},
                {name:'Servlet/JSP深入详解'}
            ],
            show:true
        }
    })
</script>
</html>